package com.gnerv.pabu.basic.core.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;

@Slf4j
public class ConvertUtils {

    public static <T> T convert(Class<T> tClass, Object object) {
        T t = null;
        try {
            t = tClass.newInstance();
        } catch (InstantiationException e) {
            log.info("实例化失败");
        } catch (IllegalAccessException e) {
            log.info("实例化失败");
        }
        BeanUtils.copyProperties(object, t);
        return t;
    }

}
